/**
 * 
 */
package edu.wpi.cs509.messages.client;

import java.util.List;
import edu.wpi.cs509.representation.GameListItem;

/**
 * This class implements the reply message for a get-games request. 
 * It returns a list of games.
 * @author sparadis
 *
 */
public class MsgGetGamesReply extends MsgClientContext {
	/**
	 * serializable version number
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * The list of joinable games. 
	 */
	protected List<GameListItem> games;
	
	/**
	 * Constructor.
	 * @param games - list of joinable games
	 */
	public MsgGetGamesReply(List<GameListItem> games) {
		this.games = games;
	}
	
	/**
	 * Give the list of games to the client.
	 */
	public void rxExecute() {
		//give the joinable games results to the client logic
		getCl().receiveGames(games);
	}

}
